import { createBrowserRouter, RouteObject } from 'react-router-dom'
import MainLayout from '../layouts/MainLayout'
import LoginPage from '../pages/LoginPage'
import DashboardPage from '../pages/DashboardPage'
import FinancingPage from '../pages/FinancingPage'
import AuthenticationPage from '../pages/AuthenticationPage'
import BlacklistPage from '../pages/BlacklistPage'
import UsersPage from '../pages/UsersPage'
import ReportsPage from '../pages/ReportsPage'
import SettingsPage from '../pages/SettingsPage'

const routes: RouteObject[] = [
  {
    path: '/login',
    element: <LoginPage />,
  },
  {
    path: '/',
    element: <MainLayout />,
    children: [
      {
        index: true,
        element: <DashboardPage />,
      },
      {
        path: '/financing',
        element: <FinancingPage />,
      },
      {
        path: '/authentication',
        element: <AuthenticationPage />,
      },
      {
        path: '/blacklist',
        element: <BlacklistPage />,
      },
      {
        path: '/users',
        element: <UsersPage />,
      },
      {
        path: '/reports',
        element: <ReportsPage />,
      },
      {
        path: '/settings',
        element: <SettingsPage />,
      },
    ],
  },
]

const router = createBrowserRouter(routes)

export default router
